package com.example.excel.ui.adapter;

import android.text.TextUtils;

import com.example.excel.bean.InventoryBean;

public class FormHelper {

    public static final String[] titles = {
            "序号",
            "资产名称",
            "盘点状态",
            "资产编码",
            "盘点单号",
            "规格型号",
            "管理部门",
            "管理人员",
            "使用地点",
            "使用人"
    };

    public static String getItemName(int index) {
        return titles[index];
    }

    public static String getItemData(InventoryBean model, int index, int rowIndex) {
        String itemRes = "";
        switch (index) {
            case 0:
                itemRes = "" + rowIndex;
                break;
            case 1:
                itemRes = model.getFaName();
                break;
            case 2:
                itemRes = model.getFaFlag() == 1 ? "已盘" : "未盘";
                break;
            case 3:
                itemRes = model.getFaCode();
                break;
            case 4:
                itemRes = model.getFaNo();
                break;
            case 5:
                itemRes = model.getFaModel();
                break;
            case 6:
                itemRes = model.getMgrDept();
                break;
            case 7:
                itemRes = model.getMgrUser();
                break;
            case 8:
                itemRes = model.getUsePlace();
                break;
            case 9:
                itemRes = model.getUseUser();
                break;
        }
        return TextUtils.isEmpty(itemRes) ? "" : itemRes;
    }
}
